<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class UpdateUserFollowCache extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        # 小时缓存表中增加 渠道名称字段
        Schema::table('user_follow_cache_hour', function (Blueprint $table) {
            $table->string('channel_name')->default('')->after('channel')->comment('渠道名称  ID为0 时 是 APP');
        });

        # 天缓存表中增加 渠道名称字段
        Schema::table('user_follow_cache_day', function (Blueprint $table) {
            $table->string('channel_name')->default('')->after('channel')->comment('渠道名称  ID为0 时 是 APP');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user_follow_cache_hour', function (Blueprint $table) {
            $table->dropColumn('channel_name');
        });

        Schema::table('user_follow_cache_day', function (Blueprint $table) {
            $table->dropColumn('channel_name');
        });
    }
}
